package com.yf.exam.modules.paper.dto.response;

import com.yf.exam.modules.paper.dto.PaperDTO;
import com.yf.exam.modules.paper.dto.ext.PaperGroupExtDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;


/**
 * 考试详情响应类
 * @author bool
 */
@Data
@ApiModel(value="考试详情", description="考试详情")
public class ExamDetailRespDTO extends PaperDTO {

    @ApiModelProperty(value = "考试机会", required=true)
    private Integer chance;

    @ApiModelProperty(value = "允许答题设备0全部1电脑2手机", required=true)
    private Integer answerDevice;

    @ApiModelProperty(value = "摄像头开关", required=true)
    private Boolean camOn;

    @ApiModelProperty(value = "摄像头截屏评率", required=true)
    private Integer camInterval;

    @ApiModelProperty(value = "离开检测开关", required=true)
    private Boolean leaveOn;

    @ApiModelProperty(value = "离开判定秒数", required=true)
    private Integer leaveCheck;

    @ApiModelProperty(value = "允许离开总次数", required=true)
    private Integer leaveCount;

    @ApiModelProperty(value = "无动作检测开关", required=true)
    private Boolean actionOn;

    @ApiModelProperty(value = "无动作时间", required=true)
    private Integer actionInterval;

    @ApiModelProperty(value = "考试通过积分", required=true)
    private Integer points;

    @ApiModelProperty(value = "最低交卷时间", required=true)
    private Integer handMin;

    @ApiModelProperty(value = "允许迟到分钟", required=true)
    private Integer lateMax;

    @ApiModelProperty(value = "允许迟到分钟", required=true)
    private Boolean waterMark;

    @ApiModelProperty(value = "题目列表", required=true)
    private List<PaperGroupExtDTO> groupList;


    @ApiModelProperty(value = "剩余结束秒数", required=true)
    public Long getLeftSeconds(){
        return (this.getLimitTime().getTime() - System.currentTimeMillis()) / 1000;
    }

}
